<?php

/**
 * @package App
 * @subpackage class
 */
 
/**
 * Agent
 *
 * @package     App
 * @subpackage  class
 * @author      $Author: moriwaki $
 * @version     $Id: App_Agent.php 408 2008-07-02 06:43:40Z moriwaki $
 */
abstract class App_Agent extends BEAR_Agent
{

    function __construct()
    {
        parent::__construct();
    }

    /**
     * 端末ID取得
     *
     * @return string
     */
    public function getDeviceSerial()
    {
        $piev = BEAR::$ua;
        $serial = '';
        $agent = BEAR_Agent::getInstance();
                
        switch($piev){
        case BEAR_Agent::UA_DOCOMO:
        
            $serial = $agent->getCardID();
            if($serial == ''){
                $serial = $agent->getSerialNumber();
            }
            break;

        case BEAR_Agent::UA_AU:
            $serial = $agent->getHeader('X-UP-SUBNO');
            break;

        case BEAR_Agent::UA_SOFTBANK:
            $serial = $agent->getSerialNumber();
            break;

        default :
            break;
        }

        return $serial;
    }
}
